<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <#include "/pubHeadStyleTree.html">
    <script type="text/javascript" src="${ctx}/workflowStatic/js/javacode/codemirror.js"></script>
    <script type="text/javascript" src="${ctx}/workflowStatic/js/javacode/InitMirror.js"></script>
    <script type="text/javascript" src="${ctx}/workflowStatic/js/commonScript.js"></script>
    <link href="${ctx}/workflowStatic/style/css/workflow.css" rel="stylesheet">
</head>
<body>
<table class="table-detail" lay-filter="otherParam" style="margin: 10px 6px;width: 98%">
    <tr>
        <th style="width: 15%">脚本:</th>
        <td >
            <div>
                <span class="commonScript" style="cursor: pointer;">
                    <i class="layui-icon layui-icon-fonts-code"></i>常用脚本
                </span>
            </div>
            <div class="layui-form-item" style="margin: 0;">
                <textarea id="conditionCode" codemirror="true" name="conditionCode" class="layui-textarea">${data}</textarea>
            </div>
            <!--<a type="button" class="layui-btn layui-btn-xs" style="float: left; margin: 4px 4px 4px 0px;" id="condition">常用条件脚本</a>-->
            <div id="windowUrls" style="display: none"></div>
        </td>
    </tr>
</table>
<input type="hidden" id="modelId" name="modelId" value="${modelId}" />
<script>

    layui.use(['layer', 'form', 'element','setter'], function() {
        // var setter=layui.setter;
        var layer = layui.layer
            ,form = layui.form
            ,element = layui.element
            ,setter = layui.setter;
        var modelId = "${modelId}";
        var scriptIndex = parent.layer.getFrameIndex(window.name);
        $('#windowUrls').load("${ctx}/workflow/bpmNodeUser/view/conditionScript?modelId="+modelId);
        //常用条件脚本
        $('#condition').click(function () {
            parent.layer.open({
                title:'脚本',
                type: 2,
                shade: 0.3,
                area: ['90%', '90%'],
                content: serverPath.workflowPath + setter.workflowLinkPath +'bpmNodeUser/view/conditionScript'
            });
        })


    })
</script>
<script type="text/javascript" src="${ctx}/workflowStatic/js/flowVars.js"></script>
</body>
</html>